Integrand size = 23, antiderivative size = 85 \[ \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {1}{2} (a-5 b) (a-b) x-\frac {(a-5 b) (a-b) \tan (e+f x)}{2 f}+\frac {(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \]
1/2*(a-5*b)*(a-b)*x-1/2*(a-5*b)*(a-b)*tan(f*x+e)/f+1/2*(a-b)^2*sin(f*x+e)^ 2*tan(f*x+e)/f+1/3*b^2*tan(f*x+e)^3/f
Time = 1.43 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.84 \[ \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {6 \left (a^2-6 a b+5 b^2\right ) (e+f x)-3 (a-b)^2 \sin (2 (e+f x))+4 b \left (6 a-7 b+b \sec ^2(e+f x)\right ) \tan (e+f x)}{12 f} \]
(6*(a^2 - 6*a*b + 5*b^2)*(e + f*x) - 3*(a - b)^2*Sin[2*(e + f*x)] + 4*b*(6 *a - 7*b + b*Sec[e + f*x]^2)*Tan[e + f*x])/(12*f)
Time = 0.27 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.99, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4146, 366, 363, 262, 216}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin (e+f x)^2 \left (a+b \tan (e+f x)^2\right )^2dx\) |
\(\Big \downarrow \) 4146 |
\(\displaystyle \frac {\int \frac {\tan ^2(e+f x) \left (b \tan ^2(e+f x)+a\right )^2}{\left (\tan ^2(e+f x)+1\right )^2}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 366 |
\(\displaystyle \frac {\frac {(a-b)^2 \tan ^3(e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}-\frac {1}{2} \int \frac {\tan ^2(e+f x) \left (a^2-6 b a+3 b^2-2 b^2 \tan ^2(e+f x)\right )}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 363 |
\(\displaystyle \frac {\frac {1}{2} \left (\frac {2}{3} b^2 \tan ^3(e+f x)-(a-5 b) (a-b) \int \frac {\tan ^2(e+f x)}{\tan ^2(e+f x)+1}d\tan (e+f x)\right )+\frac {(a-b)^2 \tan ^3(e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}}{f}\) |
\(\Big \downarrow \) 262 |
\(\displaystyle \frac {\frac {1}{2} \left (\frac {2}{3} b^2 \tan ^3(e+f x)-(a-5 b) (a-b) \left (\tan (e+f x)-\int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)\right )\right )+\frac {(a-b)^2 \tan ^3(e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}}{f}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {\frac {1}{2} \left (\frac {2}{3} b^2 \tan ^3(e+f x)-(a-5 b) (a-b) (\tan (e+f x)-\arctan (\tan (e+f x)))\right )+\frac {(a-b)^2 \tan ^3(e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}}{f}\) |
(((a - b)^2*Tan[e + f*x]^3)/(2*(1 + Tan[e + f*x]^2)) + ((2*b^2*Tan[e + f*x ]^3)/3 - (a - 5*b)*(a - b)*(-ArcTan[Tan[e + f*x]] + Tan[e + f*x]))/2)/f
3.1.50.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) ^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ (b*(m + 2*p + 1))) Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b , c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c , 2, m, p, x]
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2), x _Symbol] :> Simp[d*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(b*e*(m + 2*p + 3))), x] - Simp[(a*d*(m + 1) - b*c*(m + 2*p + 3))/(b*(m + 2*p + 3)) Int[(e*x)^ m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && NeQ[b*c - a*d , 0] && NeQ[m + 2*p + 3, 0]
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^2, x_Symbol] :> Simp[(-(b*c - a*d)^2)*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(2*a* b^2*e*(p + 1))), x] + Simp[1/(2*a*b^2*(p + 1)) Int[(e*x)^m*(a + b*x^2)^(p + 1)*Simp[(b*c - a*d)^2*(m + 1) + 2*b^2*c^2*(p + 1) + 2*a*b*d^2*(p + 1)*x^ 2, x], x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && LtQ[p , -1]
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_ )])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim p[c*(ff^(m + 1)/f) Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)^(m/ 2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x ] && IntegerQ[m/2]
Leaf count of result is larger than twice the leaf count of optimal. \(167\) vs. \(2(77)=154\).
Time = 0.67 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.98
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+2 a b \left (\frac {\sin \left (f x +e \right )^{5}}{\cos \left (f x +e \right )}+\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )-\frac {3 f x}{2}-\frac {3 e}{2}\right )+b^{2} \left (\frac {\sin \left (f x +e \right )^{7}}{3 \cos \left (f x +e \right )^{3}}-\frac {4 \sin \left (f x +e \right )^{7}}{3 \cos \left (f x +e \right )}-\frac {4 \left (\sin \left (f x +e \right )^{5}+\frac {5 \sin \left (f x +e \right )^{3}}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )}{3}+\frac {5 f x}{2}+\frac {5 e}{2}\right )}{f}\) | \(168\) |
default | \(\frac {a^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+2 a b \left (\frac {\sin \left (f x +e \right )^{5}}{\cos \left (f x +e \right )}+\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )-\frac {3 f x}{2}-\frac {3 e}{2}\right )+b^{2} \left (\frac {\sin \left (f x +e \right )^{7}}{3 \cos \left (f x +e \right )^{3}}-\frac {4 \sin \left (f x +e \right )^{7}}{3 \cos \left (f x +e \right )}-\frac {4 \left (\sin \left (f x +e \right )^{5}+\frac {5 \sin \left (f x +e \right )^{3}}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )}{3}+\frac {5 f x}{2}+\frac {5 e}{2}\right )}{f}\) | \(168\) |
risch | \(\frac {x \,a^{2}}{2}-3 x a b +\frac {5 x \,b^{2}}{2}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a^{2}}{8 f}-\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a b}{4 f}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )} b^{2}}{8 f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} a^{2}}{8 f}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} a b}{4 f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} b^{2}}{8 f}-\frac {2 i b \left (-6 a \,{\mathrm e}^{4 i \left (f x +e \right )}+9 b \,{\mathrm e}^{4 i \left (f x +e \right )}-12 a \,{\mathrm e}^{2 i \left (f x +e \right )}+12 b \,{\mathrm e}^{2 i \left (f x +e \right )}-6 a +7 b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) | \(200\) |
1/f*(a^2*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+2*a*b*(sin(f*x+e)^5/co s(f*x+e)+(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*x+e)-3/2*f*x-3/2*e)+b^2*(1/3* sin(f*x+e)^7/cos(f*x+e)^3-4/3*sin(f*x+e)^7/cos(f*x+e)-4/3*(sin(f*x+e)^5+5/ 4*sin(f*x+e)^3+15/8*sin(f*x+e))*cos(f*x+e)+5/2*f*x+5/2*e))
Time = 0.28 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.11 \[ \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {3 \, {\left (a^{2} - 6 \, a b + 5 \, b^{2}\right )} f x \cos \left (f x + e\right )^{3} - {\left (3 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (6 \, a b - 7 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}\right )} \sin \left (f x + e\right )}{6 \, f \cos \left (f x + e\right )^{3}} \]
1/6*(3*(a^2 - 6*a*b + 5*b^2)*f*x*cos(f*x + e)^3 - (3*(a^2 - 2*a*b + b^2)*c os(f*x + e)^4 - 2*(6*a*b - 7*b^2)*cos(f*x + e)^2 - 2*b^2)*sin(f*x + e))/(f *cos(f*x + e)^3)
\[ \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \sin ^{2}{\left (e + f x \right )}\, dx \]
Time = 0.37 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.02 \[ \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {2 \, b^{2} \tan \left (f x + e\right )^{3} + 3 \, {\left (a^{2} - 6 \, a b + 5 \, b^{2}\right )} {\left (f x + e\right )} + 12 \, {\left (a b - b^{2}\right )} \tan \left (f x + e\right ) - \frac {3 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \]
1/6*(2*b^2*tan(f*x + e)^3 + 3*(a^2 - 6*a*b + 5*b^2)*(f*x + e) + 12*(a*b - b^2)*tan(f*x + e) - 3*(a^2 - 2*a*b + b^2)*tan(f*x + e)/(tan(f*x + e)^2 + 1 ))/f
Leaf count of result is larger than twice the leaf count of optimal. 1325 vs. \(2 (77) = 154\).
Time = 0.84 (sec) , antiderivative size = 1325, normalized size of antiderivative = 15.59 \[ \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\text {Too large to display} \]
1/6*(3*a^2*f*x*tan(f*x)^5*tan(e)^5 - 18*a*b*f*x*tan(f*x)^5*tan(e)^5 + 15*b ^2*f*x*tan(f*x)^5*tan(e)^5 + 3*a^2*f*x*tan(f*x)^5*tan(e)^3 - 18*a*b*f*x*ta n(f*x)^5*tan(e)^3 + 15*b^2*f*x*tan(f*x)^5*tan(e)^3 - 9*a^2*f*x*tan(f*x)^4* tan(e)^4 + 54*a*b*f*x*tan(f*x)^4*tan(e)^4 - 45*b^2*f*x*tan(f*x)^4*tan(e)^4 + 3*a^2*f*x*tan(f*x)^3*tan(e)^5 - 18*a*b*f*x*tan(f*x)^3*tan(e)^5 + 15*b^2 *f*x*tan(f*x)^3*tan(e)^5 + 3*a^2*tan(f*x)^5*tan(e)^4 - 18*a*b*tan(f*x)^5*t an(e)^4 + 15*b^2*tan(f*x)^5*tan(e)^4 + 3*a^2*tan(f*x)^4*tan(e)^5 - 18*a*b* tan(f*x)^4*tan(e)^5 + 15*b^2*tan(f*x)^4*tan(e)^5 - 9*a^2*f*x*tan(f*x)^4*ta n(e)^2 + 54*a*b*f*x*tan(f*x)^4*tan(e)^2 - 45*b^2*f*x*tan(f*x)^4*tan(e)^2 + 12*a^2*f*x*tan(f*x)^3*tan(e)^3 - 72*a*b*f*x*tan(f*x)^3*tan(e)^3 + 60*b^2* f*x*tan(f*x)^3*tan(e)^3 - 9*a^2*f*x*tan(f*x)^2*tan(e)^4 + 54*a*b*f*x*tan(f *x)^2*tan(e)^4 - 45*b^2*f*x*tan(f*x)^2*tan(e)^4 - 12*a*b*tan(f*x)^5*tan(e) ^2 + 10*b^2*tan(f*x)^5*tan(e)^2 - 12*a^2*tan(f*x)^4*tan(e)^3 + 36*a*b*tan( f*x)^4*tan(e)^3 - 30*b^2*tan(f*x)^4*tan(e)^3 - 12*a^2*tan(f*x)^3*tan(e)^4 + 36*a*b*tan(f*x)^3*tan(e)^4 - 30*b^2*tan(f*x)^3*tan(e)^4 - 12*a*b*tan(f*x )^2*tan(e)^5 + 10*b^2*tan(f*x)^2*tan(e)^5 + 9*a^2*f*x*tan(f*x)^3*tan(e) - 54*a*b*f*x*tan(f*x)^3*tan(e) + 45*b^2*f*x*tan(f*x)^3*tan(e) - 12*a^2*f*x*t an(f*x)^2*tan(e)^2 + 72*a*b*f*x*tan(f*x)^2*tan(e)^2 - 60*b^2*f*x*tan(f*x)^ 2*tan(e)^2 + 9*a^2*f*x*tan(f*x)*tan(e)^3 - 54*a*b*f*x*tan(f*x)*tan(e)^3 + 45*b^2*f*x*tan(f*x)*tan(e)^3 - 2*b^2*tan(f*x)^5 + 24*a*b*tan(f*x)^4*tan...
Time = 10.34 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.34 \[ \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a\,b-2\,b^2\right )}{f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {\sin \left (2\,e+2\,f\,x\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{2\,f}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a-b\right )\,\left (a-5\,b\right )}{2\,\left (\frac {a^2}{2}-3\,a\,b+\frac {5\,b^2}{2}\right )}\right )\,\left (a-b\right )\,\left (a-5\,b\right )}{2\,f} \]